//
//  QParamService.m
//  QoilPublic
//
//  Created by 杨凯 on 16/7/1.
//  Copyright © 2016年 杨凯. All rights reserved.
//

#import "QParamService.h"

@implementation QParamService

+ (NSString*)urlWithAction:(NSString*)action {
    return [NSString stringWithFormat:@"%@%@",Q_BASE_URL,action];
}

+ (NSString*)urlWithIOTAction:(NSString*)action {
    return [NSString stringWithFormat:@"%@%@",IOT_BASE_URL,action];
}
+ (NSString*)urlWithAction:(NSString*)action token:(NSString*)token{
    return [NSString stringWithFormat:@"%@%@?token=%@",Q_BASE_URL,action,token];
}

+ (NSString*)getToken {
    if ([QUserInfo sharedInfo].loginModel.token) {
        return [QUserInfo sharedInfo].loginModel.token;
    }else{
        return @"";
    }
}
+ (NSString *)getTel{
    if ([QUserInfo sharedInfo].loginModel.tel) {
        return [QUserInfo sharedInfo].loginModel.tel;
    }
    return nil;
}
//字典转字符串
+ (NSString*)dictToString:(id)data{
    if (!data) {
        return nil;
    }
    NSDictionary *dic = (NSDictionary *)data;
    NSData *resultData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil];
    NSString* resultString = [[NSString alloc]initWithData:resultData encoding:NSUTF8StringEncoding];
    return resultString;
}

+ (NSString*)arrToString:(id)data{
    if (!data) {
        return nil;
    }
    NSArray *arr = (NSArray *)data;
    NSData *resultData = [NSJSONSerialization dataWithJSONObject:arr options:NSJSONWritingPrettyPrinted error:nil];
    NSString* resultString = [[NSString alloc]initWithData:resultData encoding:NSUTF8StringEncoding];
    return resultString;
}


//注册
+ (NSDictionary *)registertel:(NSString *)tel
             verificationCode:(NSString *)verificationCode
                     password:(NSString *)password
                  machineCode:(NSString *)machineCode
                   pleaseCode:(NSString *)pleaseCode{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if(tel){
        [paramDict setObject:tel forKey:@"tel"];
    }
    if(verificationCode){
        [paramDict setObject:verificationCode forKey:@"verificationCode"];
    }
    if(password){
        [paramDict setObject:password forKey:@"password"];
    }
    if(machineCode){
         [paramDict setObject:machineCode forKey:@"machineCode"];
    }
    if(pleaseCode){
        [paramDict setObject:pleaseCode forKey:@"invitedcode"];
    }
    return paramDict;
}
//获取绑定银行卡获取验证码
+ (NSDictionary *)getCardCode{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *tel = [self getTel];
    [paramDict setObject:tel forKey:@"tel"];
    [paramDict setObject:@"3" forKey:@"type"];
    return paramDict;
}
//获取验证码
+ (NSDictionary *)getauthcodetel:(NSString *)tel type:(NSString *)type{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if(tel){
        [paramDict setObject:tel forKey:@"tel"];
    }
    if(type){
        [paramDict setObject:type forKey:@"type"];
    }
    return paramDict;
}

//用户登录
+ (NSDictionary *)loginWithtel:(NSString *)tel
                      password:(NSString *)password
                   machineCode:(NSString *)machineCode;{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if(tel){
        [paramDict setObject:tel forKey:@"tel"];
    }
    if(password){
        [paramDict setObject:password forKey:@"password"];
    }
    if(machineCode){
        [paramDict setObject:machineCode forKey:@"machineCode"];
    }
    return paramDict;
}

//忘记密码
+ (NSDictionary *)forgetPassWordWithtel:(NSString *)tel
                       verificationCode:(NSString *)verificationCode
                               password:(NSString *)password
                            machineCode:(NSString *)machineCode{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if(tel){
        [paramDict setObject:tel forKey:@"tel"];
    }
    if(verificationCode){
        [paramDict setObject:verificationCode forKey:@"verificationCode"];
    }
    if(password){
        [paramDict setObject:password forKey:@"password"];
    }
    if(machineCode){
        [paramDict setObject:machineCode forKey:@"machineCode"];
    }
    return paramDict;
}

//用户个人中心
+ (NSDictionary *)getMyCentreData:(NSString *)orderType{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderType){
        [paramDict setObject:orderType forKey:@"orderType"];
    }
    return paramDict;
}

//退出登录
+ (NSDictionary *)signOut{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    return paramDict;
}

//修改昵称
+ (NSDictionary *)changeNickName:(NSString *)nickName{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(nickName){
        [paramDict setObject:nickName forKey:@"nickName"];
    }
    return paramDict;
}

//全部订单
+ (NSDictionary *)allMyorderType:(NSString *)orderType start:(NSString *)start pageSize:(NSString *)pageSize{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderType){
        [paramDict setObject:orderType forKey:@"type"];
    }
    if(start){
        [paramDict setObject:start forKey:@"start"];
    }
    if(pageSize){
        [paramDict setObject:pageSize forKey:@"pageSize"];
    }
    return paramDict;
}

//订单详情
+ (NSDictionary *)detailOrderid:(NSString *)orderId{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    return paramDict;
}

//取消订单
+ (NSDictionary *)cancelOrder:(NSString *)orderId{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    return paramDict;
}

//评价订单
+ (NSDictionary *)judgeOrder:(NSString *)orderId
                       score:(NSString *)score
                     content:(NSString *)content
                        type:(NSString *)type
                labelContent:(NSString *)labelContent{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    if(score){
        [paramDict setObject:score forKey:@"score"];
    }
    if(content){
        [paramDict setObject:content forKey:@"content"];
    }
    if(type){
        [paramDict setObject:type forKey:@"type"];
    }
    if(labelContent){
        [paramDict setObject:labelContent forKey:@"labelContent"];
    }
    return paramDict;
}
//新评价订单
+ (NSDictionary *)CommentOrder:(NSString *)orderId content:(NSString *)content evalJsonstr:(NSString *)evalJsonstr{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    
    if(content){
        [paramDict setObject:content forKey:@"content"];
    }
    if(evalJsonstr){
        [paramDict setObject:evalJsonstr forKey:@"evalJsonstr"];
    }
    
    return paramDict;
}
//普通用户提交订单
+ (NSDictionary *)submitOrderName:(NSString *)name
                              time:(NSString *)time
                              city:(NSString *)city
                         limitArea:(NSString *)limitArea
                           address:(NSString *)address
                               lon:(NSString *)lon
                               lat:(NSString *)lat
                               tel:(NSString *)tel
                            flag:(NSString *)flag
                            remark:(NSString *)remark
                        OilTypeId:(NSString *)oilTypeId
                         OilPrice:(NSString *)oilPrice InputPrice:(NSString *)inputPrice FreightPrice:(NSString *)freightPrice{


    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(name){
        [paramDict setObject:name forKey:@"name"];
    }
    if(time){
        [paramDict setObject:time forKey:@"time"];
    }
    if(city){
        [paramDict setObject:city forKey:@"city"];
    }
    if(limitArea){
        [paramDict setObject:limitArea forKey:@"limitArea"];
    }
    if(address){
        [paramDict setObject:address forKey:@"address"];
    }
    if(lon){
        [paramDict setObject:lon forKey:@"lon"];
    }
    if(lat){
        [paramDict setObject:lat forKey:@"lat"];
    }
    if(tel){
        [paramDict setObject:tel forKey:@"tel"];
    }
    if(flag){
        [paramDict setObject:flag forKey:@"flag"];
    }
    if(remark){
        [paramDict setObject:remark forKey:@"remark"];
    }
    if (oilTypeId) {
        [paramDict setObject:oilTypeId forKey:@"oilTypeId"];
    }
    if (oilPrice) {
        [paramDict setObject:oilPrice forKey:@"oilPrice"];

    }
    if (inputPrice) {
        [paramDict setObject:inputPrice forKey:@"inputPrice"];
    }
    if (freightPrice) {
        [paramDict setObject:freightPrice forKey:@"freightPrice"];
    }
    return paramDict;
}

//评价详情
+ (NSDictionary *)judgeDetailorderId:(NSString *)orderId{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    return paramDict;
}

//充值界面
+ (NSDictionary *)topupMoney{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    return paramDict;
}

//充值
+ (NSDictionary *)topupFromWeChatWithType:(NSString *)type denominationid:(NSString *)denominationid money:(NSString *)money activityType:(NSString *)activityType{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(denominationid){
        [paramDict setObject:denominationid forKey:@"denominationid"];
    }
    if(type){
        [paramDict setObject:type forKey:@"type"];
    }
    if (activityType) {
        [paramDict setObject:activityType forKey:@"activityType"];
    }
    if (money) {
        [paramDict setObject:money forKey:@"money"];
    }
    return paramDict;
}

//用户付款
+ (NSDictionary *)payWithorderId:(NSString *)orderId
                   paymentStatus:(NSString *)paymentStatus
                     payPassWord:(NSString *)payPassWord
                       draweeTel:(NSString *)draweeTel
                      couponCode:(NSString *)couponCode{


    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    if(paymentStatus){
        [paramDict setObject:paymentStatus forKey:@"paymentStatus"];
    }
    if(payPassWord){
        [paramDict setObject:payPassWord forKey:@"password"];
    }
    if(draweeTel){
        [paramDict setObject:draweeTel forKey:@"draweeTel"];
    }
    if (couponCode) {
        [paramDict setObject:couponCode forKey:@"couponCode"];
    }

    return paramDict;
}

//修改头像
+ (NSDictionary *)editHeadPic{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
     return paramDict;
}

//设置支付密码
+ (NSDictionary *)setPassWord:(NSString *)payPassword{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(payPassword){
        [paramDict setObject:payPassword forKey:@"payPassword"];
    }
    return paramDict;
}

//意见反馈
+ (NSDictionary *)feedBackString:(NSString *)content{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(content){
        [paramDict setObject:content forKey:@"content"];
    }
    return paramDict;
}

//获取评价标签
+ (NSDictionary *)getEvaluationTags{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
     return paramDict;
}

//版本更新
+ (NSDictionary *)updateVersion:(NSString *)fileType{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if(fileType){
        [paramDict setObject:fileType forKey:@"fileType"];
    }
    return paramDict;
}

//加满订单详情
+ (NSDictionary *)fullOrderId:(NSString *)orderId{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderActualRefuelId"];
    }
    return paramDict;
}


//上传记事本数据
+ (NSDictionary *)upLoadDatayearMonth:(NSString *)yearMonth
                                 type:(NSString *)type
                             fileName:(NSString *)fileName{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(yearMonth){
        [paramDict setObject:yearMonth forKey:@"yearMonth"];
    }
    if(type){
        [paramDict setObject:type forKey:@"type"];
    }
    if(fileName){
        [paramDict setObject:fileName forKey:@"fileName"];
    }
    return paramDict;
}

//下载文件路径
+ (NSDictionary *)updateDatatype:(NSString *)type fileName:(NSString *)fileName{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(type){
        [paramDict setObject:type forKey:@"type"];
    }
    if(fileName){
        [paramDict setObject:fileName forKey:@"fileName"];
    }
    return paramDict;
}

//推荐有奖
+ (NSDictionary *)awardWithType:(NSString *)type{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(type){
        [paramDict setObject:type forKey:@"type"];
    }

    return paramDict;
}

//免费办证
+ (NSDictionary *)freeCertifiCateListpageNum:(NSString *)pageNum pageSize:(NSString *)pageSize{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(pageNum){
        [paramDict setObject:pageNum forKey:@"pageNum"];
    }
    if(pageSize){
        [paramDict setObject:pageSize forKey:@"pageSize"];
    }
    
    return paramDict;
}

//提交办证
+ (NSDictionary *)submitCertifiCateAddUser:(NSString *)addUser phone:(NSString *)phone certificatesNumber:(NSString *)certificatesNumber stats:(NSString *)stats{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(addUser){
        [paramDict setObject:addUser forKey:@"addUser"];
    }
    if(phone){
        [paramDict setObject:phone forKey:@"phone"];
    }
    if(certificatesNumber){
        [paramDict setObject:certificatesNumber forKey:@"certificatesNumber"];
    }
    if(stats){
        [paramDict setObject:stats forKey:@"stats"];
    }
    return paramDict;
}

//账户明细
+ (NSDictionary *)billingDetailstart_time:(NSString *)start_time
                                 end_time:(NSString *)end_time{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(start_time){
        [paramDict setObject:start_time forKey:@"start_time"];
    }
    if(end_time){
        [paramDict setObject:end_time forKey:@"end_time"];
    }
    return paramDict;
}

//忘记支付密码
+ (NSDictionary *)forgetPayPassword:(NSString *)verificationCode{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    if(verificationCode){
        [paramDict setObject:verificationCode forKey:@"verificationCode"];
    }
    return paramDict;
}

//未支付订单
+ (NSDictionary *)noPayOrder{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    [paramDict setObject:@"6" forKey:@"orderState"];
    
    return paramDict;
}

//获得金额
+ (NSDictionary *)getMoneyWithOrder:(NSString *)orderId{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    return paramDict;
}

//审请为地推
+ (NSDictionary *)reviewpleaseWithtrueName:(NSString *)trueName
                                    idcard:(NSString *)idcard
                                       tel:(NSString *)tel{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(trueName){
        [paramDict setObject:trueName forKey:@"trueName"];
    }
    if(idcard){
        [paramDict setObject:idcard forKey:@"idcard"];
    }
    if(tel){
        [paramDict setObject:tel forKey:@"tel"];
    }

    return paramDict;
}

//支付方式
+ (NSDictionary *)getPayMethodWithtype:(NSString *)type{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if(type){
        [paramDict setObject:type forKey:@"type"];
    }
    return paramDict;
}

//连接网络电话接口
+ (NSDictionary *)callPhoneWithOrderId:(NSString *)orderId flag:(NSString *)flag{

    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if(orderId){
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    if(flag){
        [paramDict setObject:flag forKey:@"flag"];
    }

    return paramDict;
}


+ (void)onTimer:(UIButton *)button type:(BOOL)type;
{
    __block int timeout=60; //倒计时时间
    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue);
    dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行
    dispatch_source_set_event_handler(_timer, ^{
        if(timeout<=0){ //倒计时结束，关闭
            dispatch_source_cancel(_timer);
            dispatch_async(dispatch_get_main_queue(), ^{
                //设置界面的按钮显示 根据自己需求设置
                [button setTitle:@"获取验证码" forState:UIControlStateNormal];
                button.backgroundColor = [UIColor clearColor];
                button.userInteractionEnabled = YES;
                [button setTitleColor:[QColorUtility defaultBlueColor] forState:UIControlStateNormal];
                
            });
        }else{
            //            int minutes = timeout / 60;
            int seconds = timeout % 60;
            NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds];
            dispatch_async(dispatch_get_main_queue(), ^{
                //设置界面的按钮显示 根据自己需求设置
                //NSLog(@"____%@",strTime);
                [button setTitle:[NSString stringWithFormat:@"%@秒后重试",strTime] forState:UIControlStateNormal];
                button.backgroundColor = [UIColor whiteColor];
                button.userInteractionEnabled = NO;
                if(type){
                    [button setTitleColor:[QColorUtility defaultDisGrayColor] forState:UIControlStateNormal];
                }else{
                    [button setTitleColor:[QColorUtility defaultDisGrayColor] forState:UIControlStateNormal];
                }
            });
            timeout--;
        }
    });
    dispatch_resume(_timer);
}

//开票信息管理
+ (NSDictionary *)findInvoiceListWithState:(NSString *)state Start:(NSString *)start pageSize:(NSString *)pageSize{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (state) {
        [paramDict setObject:state forKey:@"state"];
    }
    if (start) {
        [paramDict setObject:start forKey:@"start"];
    }
    if (pageSize) {
        [paramDict setObject:pageSize forKey:@"pageSize"];

    }
    return paramDict;
}
//删除开票信息
+ (NSDictionary *)deletInvoiceDetailWithCredentialsId:(NSString *)credentialsId{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (credentialsId) {
        [paramDict setObject:credentialsId forKey:@"credentialsId"];
    }

    return paramDict;

}

//普通发票添加
+ (NSDictionary *)createCredentialsWithInvoiceType:(NSString *)invoiceType Name:(NSString *)name Tel:(NSString *)tel Address:(NSString *)address{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (invoiceType) {
        [paramDict setObject:invoiceType forKey:@"invoiceType"];
    }
    
    if(name){
        [paramDict setObject:name forKey:@"name"];
    }
    if(tel){
        [paramDict setObject:tel forKey:@"tel"];
    }
    if(address){
        [paramDict setObject:address forKey:@"address"];
    }

    return paramDict;
}
//发票纪录列表
+ (NSDictionary *)findInvoiceRecordList{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    return paramDict;
}
//发票纪录详情
+ (NSDictionary *)findInvoiceRecordDetailWithInvoiceId:(NSString *)invoiceId{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (invoiceId) {
        [paramDict setObject:invoiceId forKey:@"invoiceId"];
    }
    
    return paramDict;

}
//获取发票详情
+ (NSDictionary *)findInvoiceDetailWithCredentialsId:(NSString *)credentialsId{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (credentialsId) {
        [paramDict setObject:credentialsId forKey:@"credentialsId"];
    }
    
    return paramDict;

}

//获取开票订单
+ (NSDictionary *)findInvoiceOrderList{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    return paramDict;
}

//获取开票订单金额，税费
+ (NSDictionary *)findInvoiceOrderMoneyWithOrderIds:(NSString *)orderIds OrderAmount:(NSString *)orderAmount InvoiceType:(NSString *)invoiceType StartDate:(NSString *)startDate EndData:(NSString *)endData{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderIds){
        [paramDict setObject:orderIds forKey:@"orderIds"];
    }
    if(orderAmount){
        [paramDict setObject:orderAmount forKey:@"orderAmount"];
    }
    if(invoiceType){
        [paramDict setObject:invoiceType forKey:@"invoiceType"];
    }
    if(startDate){
        [paramDict setObject:startDate forKey:@"startDate"];
    }
    if(endData){
        [paramDict setObject:endData forKey:@"endData"];
    }

    return paramDict;
}
//申请开票
+ (NSDictionary *)createBillingWithOrderIds:(NSString *)orderIds OrderAmount:(NSString *)orderAmount InvoiceType:(NSString *)invoiceType CredentialsId:(NSString *)credentialsId UserType:(NSString *)userType StartDate:(NSString *)startDate EndDate:(NSString *)endDate{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if(orderIds){
        [paramDict setObject:orderIds forKey:@"orderIds"];
    }
    if(orderAmount){
        [paramDict setObject:orderAmount forKey:@"orderAmount"];
    }
    if(invoiceType){
        [paramDict setObject:invoiceType forKey:@"invoiceType"];
    }
    if (credentialsId) {
        [paramDict setObject:credentialsId forKey:@"credentialsId"];
    }
    if (userType) {
        [paramDict setObject:userType forKey:@"userType"];
    }
    if(startDate){
        [paramDict setObject:startDate forKey:@"startDate"];
    }
    if(endDate){
        [paramDict setObject:endDate forKey:@"endDate"];
    }

    return paramDict;
}
//三级营销-我的佣金显示
+ (NSDictionary *)getMyCommission{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    return paramDict;
}
//三级营销-我的上下级
+ (NSDictionary *)getMySSubordinateWithStart:(NSString *)start PageSize:(NSString *)pageSize{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if(start){
        [paramDict setObject:start forKey:@"start"];
    }

    if(pageSize){
        [paramDict setObject:pageSize forKey:@"pageSize"];
    }

    return paramDict;
}

//三级营销-我的客户
+ (NSDictionary *)getMyCommissionOrdersWithCommissionId:(NSString *)commissionId Start:(NSString *)start PageSize:(NSString *)pageSize{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if (commissionId) {
        [paramDict setObject:commissionId forKey:@"commissionId"];
    }

    if(start){
        [paramDict setObject:start forKey:@"start"];
    }
    
    if(pageSize){
        [paramDict setObject:pageSize forKey:@"pageSize"];
    }

    return paramDict;
}


+ (NSDictionary *)getInvoiceType{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    return paramDict;
}

//积分明细
+ (NSDictionary *)getIntegralOrderInfoActionWithOper_type:(NSString *)oper_type    Start:(NSString *)start PageSize:(NSString *)pageSize{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if (oper_type) {
        [paramDict setObject:oper_type forKey:@"oper_type"];

    }
    
    if(start){
        [paramDict setObject:start forKey:@"curr_page"];
    }
    
    if(pageSize){
        [paramDict setObject:pageSize forKey:@"request_num"];
    }


    return paramDict;
}

//签到详情
+ (NSDictionary *)getUserSignInInfoAction{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    return paramDict;
}

//签到 1签到 2分享 3评价
+ (NSDictionary *)userSignInActionWithAdd_type:(NSString *)add_type{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if (add_type) {
        [paramDict setObject:add_type forKey:@"add_type"];
    }
    
    return paramDict;

}

//卡券类型 1已生成 2已核销 3已过期
+ (NSDictionary *)getUserAllCouponWithCoupon_state:(NSString *)coupon_state Start:(NSString *)start PageSize:(NSString *)pageSize{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if(coupon_state){
        [paramDict setObject:coupon_state forKey:@"couponState"];
    }
    
    if(start){
        [paramDict setObject:start forKey:@"start"];
    }
    
    if(pageSize){
        [paramDict setObject:pageSize forKey:@"pageSize"];
    }

    return paramDict;
    

}

//可用卡券请求
+ (NSDictionary *)getUserCanUsedCouponWithOrderid:(NSString *)orderid{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if(orderid){
        [paramDict setObject:orderid forKey:@"orderId"];
    }

    return paramDict;
}

//可用卡券数量
+ (NSDictionary *)getUserCanUsedCoupanCntWithOrderid:(NSString *)orderid{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if(orderid){
        [paramDict setObject:orderid forKey:@"orderId"];
    }
    
    return paramDict;

}

//卡券详情
+ (NSDictionary *)getCouponValueWithCardCode:(NSString *)cardCode{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    if(cardCode){
        [paramDict setObject:cardCode forKey:@"cardCode"];
    }
    
    return paramDict;

}
//兑换券码
+ (NSDictionary *)UserAccessCardWithType:(NSString *)type Card_code:(NSString *)card_code{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (type) {
        [paramDict setObject:type forKey:@"type"];
    }
    if(card_code){
        [paramDict setObject:card_code forKey:@"card_code"];
    }
    
    return paramDict;
    
}

//积分商城 兑吧
+ (NSDictionary *)integralMallURL{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }else{
        [paramDict setObject:@"" forKey:@"token"];
    }

    return paramDict;
}

//获取历史地址
+ (NSDictionary *)getHistoryAddress{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    return paramDict;
}

//加油过程
+ (NSDictionary *)getCarRealtimeComeonDataWithOrderId:(NSString *)orderId{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (orderId) {
        [paramDict setObject:orderId forKey:@"orderId"];
    }
    
    return paramDict;

}

//获取消息分类列表
+ (NSDictionary *)getTypeListWithMachineId:(NSString *)machineId Start:(NSString *)start PageSize:(NSString *)pageSize{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    if (machineId) {
        [paramDict setObject:machineId forKey:@"mac"];
    }
    if (start) {
        [paramDict setObject:start forKey:@"start"];
    }
    if (pageSize) {
        [paramDict setObject:pageSize forKey:@"pageSize"];
    }

    return paramDict;
}

//机器码
+ (NSString *)getUUID{
    
    NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
    if ([user objectForKey:@"UUID"]) {
        return [user objectForKey:@"UUID"];
    }else{
        
        CFUUIDRef uuid = CFUUIDCreate(NULL);
        assert(uuid != NULL);
        CFStringRef uuidStr = CFUUIDCreateString(NULL, uuid);
        NSString * UUID = [NSString stringWithFormat:@"%@",uuidStr];
        [user setObject:UUID forKey:@"UUID"];
        return UUID;

    }

}

//上传机器码
+ (NSDictionary *)addMacInfoWithMac:(NSString *)mac UmdUids:(NSString *)umdUids{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];

    if (mac) {
        [paramDict setObject:mac forKey:@"mac"];
    }
    if (umdUids) {
        [paramDict setObject:umdUids forKey:@"umdUids"];
    }
    return paramDict;
}

//获取用户是否有未读消息
+ (NSDictionary *)getIsUnLookWithMac:(NSString *)mac{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    if (mac) {
        [paramDict setObject:mac forKey:@"mac"];
    }
    return paramDict;
}

//获取首页消息
+ (NSDictionary *)getMsgNewInfoWithMac:(NSString *)mac PtType:(NSString *)ptType{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if (mac) {
        [paramDict setObject:mac forKey:@"mac"];
    }
    if (ptType) {
        [paramDict setObject:ptType forKey:@"ptType"];
    }
    return paramDict;
}
//获取消息分类列表
+ (NSDictionary *)getMsgListWithMac:(NSString *)mac PtTypeh:(NSString *)ptType Start:(NSString *)start PageSize:(NSString *)pageSize{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }else{
        [paramDict setObject:@"" forKey:@"token"];
    }
    if (ptType) {
        [paramDict setObject:ptType forKey:@"ptType"];
    }
    if (mac) {
        [paramDict setObject:mac forKey:@"mac"];
    }
    if (start) {
        [paramDict setObject:start forKey:@"start"];
    }
    if (pageSize) {
        [paramDict setObject:pageSize forKey:@"pageSize"];
    }
    
    return paramDict;
}
//更新消息查看状态
+ (NSDictionary *)addPushIsLookWithPurId:(NSString *)purId{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if (purId) {
        [paramDict setObject:purId forKey:@"purId"];
    }
    return paramDict;
}
//获取完善订单信息
+ (NSDictionary *)getSaveOrderInformationWithCity:(NSString *)city Area:(NSString *)area{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }

    if (city) {
        [paramDict setObject:city forKey:@"city"];
    }
    
    if (area) {
        [paramDict setObject:area forKey:@"area"];
    }
    return paramDict;

}
//首页广告倒计时广告
+ (NSDictionary *)indexAdvertWithSrcId:(NSString *)srcId SrType:(NSString *)srType{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    if (srcId) {
        [paramDict setObject:srcId forKey:@"srcId"];
    }
    
    if (srType) {
        [paramDict setObject:srType forKey:@"srType"];
    }
    return paramDict;

}
//获取车辆经纬度
+ (NSDictionary *)getPositionWithCarNumber:(NSString *)carNumber{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    if (carNumber) {
        [paramDict setObject:carNumber forKey:@"carNumber"];
    }
    return paramDict;

}
//通讯录上报
+ (NSDictionary *)saveAddressBookWithInfo:(NSString *)info{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    if (info) {
        [paramDict setObject:info forKey:@"list"];
    }

    return paramDict;
}
//活动
+ (NSDictionary *)getInviterActivityInfo{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }
    
    [paramDict setObject:@"0" forKey:@"type"];

    return paramDict;
}

+ (NSDictionary *)getUsercard{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
   
    NSString *token = [self getToken];
    if(token){
        [paramDict setObject:token forKey:@"token"];
    }else{
         token = @"111";
    }

    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:@"0" forKey:@"srcId"];
    [paramDict setObject:@"20" forKey:@"srType"];
    
    return paramDict;
    
}
//获取是否有绑定银行
+ (NSDictionary *)GainIsOrNoBanks{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
    
    [paramDict setObject:token forKey:@"token"];
    
    return paramDict;
}
//获取所有银行
+ (NSDictionary *)GainALLBanks{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
   
    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:@"0" forKey:@"cusType"];

    return paramDict;
}

//绑定银行卡
+ (NSDictionary *)BindingBankWithName:(NSString *)name CardType:(NSString *)cardType CardNum:(NSString *)cardNum  Identity:(NSString *)identity Ramark:(NSString *)ramark Code:(NSString *)code{
    
     NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
    NSString *tel = [self getTel];
    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:@"0" forKey:@"cusType"];//0 客户端 1 商户端
    [paramDict setObject:cardType forKey:@"typeId"];//1 支付宝 2 微信 3以上表示对应银行
    [paramDict setObject:tel forKey:@"tel"];
    [paramDict setObject:cardNum forKey:@"cardNumber"];
    [paramDict setObject:name forKey:@"name"];
    [paramDict setObject:ramark forKey:@"ramark"];
    [paramDict setObject:code forKey:@"verificationCode"];
    [paramDict setObject:identity forKey:@"identity"];
    
    return paramDict;

    
}
//获取提现数据
+ (NSDictionary *)GainTiXianWithCardId:(NSString *)cardType CardNum:(NSString *)cardNum Money:(NSString *)money{
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
    
    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:@"0" forKey:@"cusType"];//0 客户端 1 商户端
    [paramDict setObject:cardType forKey:@"blankId"];//1 支付宝 2 微信 3以上表示对应银行
    [paramDict setObject:cardNum forKey:@"number"];
    [paramDict setObject:money forKey:@"momery"];
    
    return paramDict;
}

//获取订单通知信息
+ (NSDictionary *)gainOrderInfoWithStart:(NSString *)start pageSize:(NSString *)pageSize{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
    NSString *mac = [QParamService getUUID];
    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:mac forKey:@"mac"];
    [paramDict setObject:@"1" forKey:@"ptType"];// 1订单通知，2钱包通知，3广告通知
    [paramDict setObject:start forKey:@"start"];
    [paramDict setObject:pageSize forKey:@"pageSize"];
    return paramDict;
}
//星级文字
+ (NSDictionary *)GainStarText{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    NSString *token = [self getToken];
    [paramDict setObject:token forKey:@"token"];
    
    return paramDict;
}

+ (NSDictionary *)GainValuationDataWithOrderId:(NSString *)orderNum{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
    NSString *orderId = orderNum;
    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:orderId forKey:@"orderId"];
    
    return paramDict;
}

+ (NSDictionary *)GainTransactionDetailsWithStart:(NSString *)start pageSize:(NSString *)pageSize{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
    NSString *starts = start;
    NSString *pageSizes = pageSize;
    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:starts forKey:@"start"];
    [paramDict setObject:pageSizes forKey:@"pageSize"];
    
    return paramDict;
}

//智能加油申请
+ (NSDictionary *)GainUserInfoWithName:(NSString *)name Phone:(NSString *)phone{
    
    NSMutableDictionary *paramDict = [NSMutableDictionary dictionary];
    
    NSString *token = [self getToken];
    NSString *userName = name;
    NSString *userPhone = phone;
    [paramDict setObject:token forKey:@"token"];
    [paramDict setObject:userName forKey:@"name"];
    [paramDict setObject:userPhone forKey:@"phone"];
    
    return paramDict;
}

@end
